Below a batch script (.bat) to first execute a migration of projects given in parameters (zip), then execute 3 command lines on each project after migration: Refresh Representations, Remove Hidden Elements, and Export All Representations as images.
To execute it:
thisScript.bat <FolderabsolutePathToProjectA.zip #absolutePathToProjectB.zip #absolutePathToProjectC.zip
If you migrate a project using libraries, all dependent projects/libraries must be included.
@ECHO off :: Mandatory to set SET CAPELLA_HOME=<Capella installation> IF [%1]==[] ( ECHO Missing input EXIT /b ) ELSE IF EXIST %1\ ( ::A folder SET IMPORT_INPUT=-importAll %1 ) ELSE IF EXIST %1 ( ::A file SET IMPORT_INPUT=-import %1 ) ELSE ( ECHO %1 does not exist EXIT /b ) IF NOT DEFINED CAPELLA_WS SET CAPELLA_WS=%CAPELLA_HOME%\migration.ws SET CAPELLA_LOGS=%CAPELLA_WS%\log.html SET CAPELLA_CMD="%CAPELLA_HOME%\capella\capellac.exe" ^ -nosplash -consoleLog ^ -application org.polarsys.capella.core.commandline.core ^ -data "%CAPELLA_WS%" ^ -logfile "%CAPELLA_LOGS%" ECHO. ECHO # ECHO # Migrate of projects of %PROJECTS_SET% ECHO # %CAPELLA_CMD% ^ -appid org.polarsys.capella.migration ^ %IMPORT_INPUT% ^ -input /all ^ -forceimport ^ -refreshRepresentations ECHO. ECHO # ECHO # Remove Hidden Elements ECHO # %CAPELLA_CMD% ^ -appid org.polarsys.capella.removeHiddenElements ^ -input /all ^ -unsyncDiags ECHO. ECHO # ECHO # Export diagrams and zip all projects ECHO # %CAPELLA_CMD% ^ -appid org.polarsys.capella.exportRepresentations ^ -input /all ^ -exportToHTML ^ -exportProjects /all ^ -singleZip ^ -exportTarget MigratedProject.zip ^ -outputfolder export/diagrams